package com.todod.base.module.base.dal.mysql.rtdistribute;

import java.util.*;

import com.todod.base.framework.common.pojo.PageResult;
import com.todod.base.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.todod.base.framework.mybatis.core.mapper.BaseMapperX;
import com.todod.base.module.base.dal.dataobject.rtdistribute.RtDistributeDO;
import org.apache.ibatis.annotations.Mapper;
import com.todod.base.module.base.controller.admin.rtdistribute.vo.*;

/**
 * 实时数据分发 Mapper
 *
 * @author 超管儿
 */
@Mapper
public interface RtDistributeMapper extends BaseMapperX<RtDistributeDO> {

    default PageResult<RtDistributeDO> selectPage(RtDistributePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RtDistributeDO>()
                .eqIfPresent(RtDistributeDO::getIpAddress, reqVO.getIpAddress())
                .eqIfPresent(RtDistributeDO::getPort, reqVO.getPort())
                .betweenIfPresent(RtDistributeDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(RtDistributeDO::getId));
    }

}